unit basicio_street;

{$mode objfpc}{$H+}

{
  stores all informations about a single street on the playfield
}

interface

uses
  Classes, SysUtils, fgl, basicio_player, basicio_city;

type
  TStreetPosition = array[0..1] of TCityPosition;

  { TStreet }
  TStreet = class
    private
      FPos: TStreetPosition;
      FOwner: TPlayer;
    public
      constructor Create(APos: TStreetPosition; AOwner: TPlayer);
      destructor Destroy; override;
    public
      property Owner: TPlayer read FOwner;
      property Position: TStreetPosition read FPos;
  end;

  TStreetList = specialize TFPGObjectList<TStreet>;

  operator = (const a,b: TStreetPosition): boolean;

implementation

operator=(const a, b: TStreetPosition): boolean;
begin
  result := ((a[0]=b[0]) and (a[1]=b[1])) or ((a[0]=b[1]) and (a[1]=b[0]));
end;

{ TStreet }

constructor TStreet.Create(APos: TStreetPosition; AOwner: TPlayer);
begin
  inherited Create;
  FPos   := APos;
  FOwner := AOwner;
end;

destructor TStreet.Destroy;
begin
  inherited Destroy;
end;

end.

